import { Link } from '@brillout/docpress'
import { ConfigSpec } from '../../components'

<ConfigSpec
  env="client"
  global={null}
/>

Get <Link href="/pageContext">`pageContext`</Link> of the currently rendered page on the client-side.

It's usually used for getting the `pageContext` of a newly navigated page:

```tsx
import { getPageContextClient, navigate } from 'vike/client/router'

function SignupForm() {
  return <form onSubmit={onSubmit}>{/* ... */}</form>
}

async function onSubmit() {
  await navigate('/welcome')
  // Get the `pageContext` object of the newly navigated /welcome page
  const pageContext = getPageContextClient()
  // ...
}
```

## See also

- <Link href="/pageContext" />
- <Link href="/navigate" />
